package com.ruoyi.project.cms.pro.controller;

import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.cms.pro.domain.CmsProInfo;
import com.ruoyi.project.cms.pro.service.CmsProInfoService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;


import java.util.List;

@Controller
@RequestMapping("/pro/info")
public class CmsProInfoController  extends BaseController {
    @Autowired
    private CmsProInfoService cmsProInfoService;

    String  prefix="/cms/pro";

    @GetMapping("")
    public String info()
    {
        return  prefix+ "/info";
    }

    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list(CmsProInfo cmsProInfo){
        startPage();

        List<CmsProInfo> list = cmsProInfoService.findMore(cmsProInfo);
        return getDataTable(list);
    }

    @GetMapping("/selectOne/{pid}")
    public String selectOne(@PathVariable("pid") Integer pid, ModelMap mmap)
    {
        mmap.put("cmsProInfo", cmsProInfoService.selectcmsProInfoById(pid));
        return prefix + "/one";
    }




}
